import { apiClient } from "@/utils/request";

export const fetchLogin = (loignParams) => {
  return apiClient({
    url: "/api/user/login",
    method: "post",
    data: loignParams,
  });
};

export const fetchRegister = (registerParams) => {
  return apiClient({
    url: "/api/user/register",
    method: "post",
    data: registerParams,
  });
};

export const fetchallUsers = () => {
  return apiClient({
    url: "/api/user/all",
    method: "get",
  });
};

export const updateUsers = (data) => {
  return apiClient({
    url: "/api/user/update",
    method: "post",
    data: data,
  });
};

export const deleteUsers = (id) => {
  return apiClient({
    url: "/api/user/delete",
    method: "get",
    params: { id: id },
  });
};
